package com.jetinno.light_app

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.widget.Button
import com.jetinno.light.AmbientLightCallBack
import com.jetinno.light.AmbientLightDF
import com.jetinno.light.AmbientLightManager
import timber.log.Timber

/**
 * Created by zhangyuncai on 2024/11/1.
 * 描述：
 */
class LightMainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)


        findViewById<Button>(R.id.bt_main_showlightdf)
            .setOnClickListener {
                showLightDF()
            }

        AmbientLightManager.init(application)
        AmbientLightManager.ambientLightCallBack=object :AmbientLightCallBack{
            override fun enableLight(): Boolean {
                return true
            }

            override fun sendCmdAndReceive(cmd: String) {
                Timber.e("sendCmdAndReceive:"+cmd)
            }

        }
    }

    fun showLightDF(){
        AmbientLightDF.showAmbientLightDF(this,supportFragmentManager)
    }

}